package cn.liontalk;

import org.springframework.amqp.core.ExchangeTypes;
import org.springframework.amqp.rabbit.annotation.*;
import org.springframework.stereotype.Component;

/**
 * @author: 周哲
 * @package: cn.liontalk
 * @description: app 推送消费者
 * @date: 2019/1/11 14:12
 * @version: V1.0
 */
@Component
@RabbitListener(
        bindings = @QueueBinding(
                value = @Queue(value = "${mq.config.queue.push}", autoDelete = "false"),
                exchange = @Exchange(value = "${mq.config.exchange}", type = ExchangeTypes.DIRECT),
                key = "${mq.config.queue.push.routing.key}"
        )

)
public class PushConsumer {

    @RabbitHandler
    public void receiveMessage(String message) {
        System.out.println("Push Consumer :" + message);
        throw new RuntimeException();
    }
}
